import request from '@/utils/request'

// 查询人气推荐列表
export function listHotProduct(query) {
  return request({
    url: '/supermarket/hotProduct/list',
    method: 'get',
    params: query
  })
}

// 查询人气推荐详细
export function getHotProduct(id) {
  return request({
    url: '/supermarket/hotProduct/' + id,
    method: 'get'
  })
}

// 新增人气推荐
export function addHotProduct(data) {
  return request({
    url: '/supermarket/hotProduct',
    method: 'post',
    data: data
  })
}

// 修改人气推荐
export function updateHotProduct(data) {
  return request({
    url: '/supermarket/hotProduct',
    method: 'put',
    data: data
  })
}

// 上下架人气推荐
export function publishHotProduct(data) {
  return request({
    url: '/supermarket/hotProduct/publish',
    method: 'post',
    data: data
  })
}

// 删除人气推荐
export function delHotProduct(id) {
  return request({
    url: '/supermarket/hotProduct/' + id,
    method: 'delete'
  })
}
